* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #000;
}

.effect {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background-color: #fff;
    /* 对比度 */
    filter: contrast(10);
}

.blackball, .redball {
    position: absolute;
    left: 50%;
    top: 50%;
    padding: 10px;
    /* 设置模糊度，配合上面的 contract 来显示圆形求的粘性效果 */
    filter: blur(5px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.blackball {
    width: 100px;
    height: 100px;
    background-color: #000;
}

.redball {
    width: 60px;
    height: 60px;
    background-color: #f00;
    animation: ball 5s infinite;
}

/* 定义红色球的动画效果 */
@keyframes ball {
    0%,
    100% {
        left: 50px;
        width: 60px;
        height: 60px;
    }
    4%,54% {
        width: 60px;
        height: 60px;
    }
    10%,60% {
        width: 50px;
        height: 70px;
    }
    20%,70% {
        width: 60px;
        height: 60px;
    }
    34%,90% {
        width: 70px;
        height: 50px;
    }
    41% {
        width: 60px;
        height: 60px;
    }
    50% {
        left: 270px;
        width: 60px;
        height: 60px;
    }
}
